#!/bin/bash

echo " 1:channel 2:cache 3:location 4:friends 5:all 6:guild, 7:Engine 8:Engine_New"
read input
echo $input

if [ 1 == $input ]
then
	cd ../pz_channel
	svn up
	
	cd Debug
	make clean;make all -j8
	
	cp pz_channel pz_channel2
fi


if [ 2 == $input ]
then
	cd ../CacheServer
	svn up
	
	cd Debug
	make clean;make all -j8
fi

if [ 3 == $input ]
then
	cd ../LocationServer
	svn up
	
	cd Debug
	make clean;make all -j8
fi 

if [ 4 == $input ]
then
	cd ../FriendsServer
	svn up
	
	cd Debug
	make clean;make all -j8
fi 

if [ 5 == $input ]
then
	cd ../trunk
	svn up
	
	cd ../trunk/FriendsServer/Debug
	make clean;make all -j8
	
	echo "===================================="
	echo "FriendsServer build done"
	echo "===================================="
	
	
	cd ../../../trunk/LocationServer/Debug
	make clean;make all -j8
	
	echo "===================================="
	echo "LocationServer build done"
	echo "===================================="
	
	cd ../../../trunk/CacheServer/Debug
	make clean;make all -j8
	
	echo "===================================="
	echo "CacheServer build done"
	echo "===================================="

	cd ../../../trunk/GuildServer/Debug
	make clean;make all -j8
	
	echo "===================================="
	echo "GuildServer build done"
	echo "===================================="
	
	cd ../../../trunk/pz_channel/Debug
	make clean;make all -j8
	
	echo "===================================="
	echo "pz_channel build done"
	echo "===================================="
fi 

if [ 6 == $input ]
then
	cd ../GuildServer
	svn up
	
	cd Debug
	make clean;make all -j8
fi 

if [ 7 == $input ]
then
	cd ../Engine
	svn up
	cd Libs
	./Clean.sh
	./Make.sh
fi 

if [ 8 == $input ]
then
	cd ../Engine_New
	svn up
	cd Libs
	./Clean.sh
	./Make.sh
fi 






